<template>
    <div class='classify'>
        <div class="container">
            <el-row :gutter="10" class="mb8">
                <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
            </el-row>
            <el-table border v-loading="loading" :data="tableList" ref="tableList" v-tableHeight :height="tableList.length > 0 ? '900px' : '120px'"
                :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"  row-key="id" default-expand-all>
                <el-table-column label="分类名称" align="center" prop="name" />
                <el-table-column label="封面" align="center" prop="cover" >
                    <template slot-scope="scope">
                        <div v-if="scope.row.cover" class="img-list">
                            <el-image style="width: auto; height: 50px;" :src="scope.row.cover"
                                :preview-src-list="[scope.row.cover]">
                            </el-image>
                        </div>
                    </template>
                </el-table-column>
                <el-table-column label="编号" align="center" prop="id" />
                <el-table-column label="备注" align="center" prop="remark" />
               
                <!-- <el-table-column label="级别" align="center" prop="amount" />
                <el-table-column label="商品数量" align="center" prop="pay_way" />
                <el-table-column label="数量单位" align="center" prop="source" />
                <el-table-column label="导航栏" align="center" prop="source" />
                <el-table-column label="是否显示" align="center" prop="source" />
                <el-table-column label="排序" align="center" prop="source" />
                <el-table-column label="设置" align="center" prop="source" /> -->
                <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
                    <template slot-scope="scope">
                        <el-button size="mini" type="text" icon="el-icon-edit" @click="form=JSON.parse(JSON.stringify(scope.row));handleShow='edit'"
                            v-hasPermi="['basic:nursing:edit']">
                            编辑
                        </el-button>
                        <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['user:depart:del']">
                            删除</el-button>
                    </template>
                </el-table-column> -->
            </el-table>
            <pagination v-show="pageCount > 0" :pageCount="pageCount" :page.sync="queryParams.page" :limit.sync="queryParams.limit" @pagination="getList" />
        </div>
    </div>
</template>

<script>
import { getGoodsCateLists } from "@/api/goods/goods"
export default {
    name: 'classify',
    components: {

    },
    data() {
        return {
            showSearch: true,
            loading: false,
            pageCount: 0,
            total: 0,
            queryParams: {
                page: 1,
                limit: 20,
                key: null,
            },
            tableList: [{}],
        }
    },
    created() {
        this.getList()
    },
    methods: {
        getList() {
            this.loading = true;
            getGoodsCateLists().then(res => {
                this.tableList = res.data;
                this.pageCount = res.data.pageCount;
                this.loading = false;
            });
        },
        handleQuery() {
            this.queryParams.page = 1;
            this.getList();
        },
        resetQuery() {
            this.resetForm("queryForm");
            this.handleQuery();
        },
    },
}

</script>
<style scoped lang='scss'>
/deep/.top-right-btn {
    button:nth-child(1) {
        display: none;
    }
}
</style>